#ifndef __POOL_H__
#define __POOL_H__

#include "task_list.hpp"
#include "thread.hpp"
#include "consumer_thread.hpp"
#include <vector>
#include <memory>


namespace rocket 
{
class task;
using elemtype1 = thread *;

class pool
{
public:
friend consumer_thread;
public:
    pool(int pool_capacity,int task_list_capacity) ;
    ~pool() ;
    void add_task(elemtype2);
    void start();
    void stop();
private:
    void take_task();
private:
    std::vector<std::unique_ptr<thread>> _thread_pool;
    int _pool_capacity;
    task_list _list;
    bool _exit_signal;
};

}

#endif